package cn.com.lyj6851.modules.user.service;

import cn.com.lyj6851.common.service.BaseService;
import cn.com.lyj6851.modules.user.domain.YdyUserAddress;
import cn.com.lyj6851.modules.user.param.AddressParam;
import cn.com.lyj6851.modules.user.vo.YdyUserAddressQueryVo;

import java.util.List;

public interface YdyUserAddressService extends BaseService<YdyUserAddress> {

    /**
     * 设置默认地址
     * @param uid uid
     * @param addressId 地址id
     */
    void setDefault(Long uid,Long addressId);

    /**
     * 添加或者修改地址
     * @param uid uid
     * @param param AddressParam
     */
    Long addAndEdit(Long uid, AddressParam param);

    /**
     * 地址详情
     * @param id 地址id
     * @return YdyUserAddressQueryVo
     */
    YdyUserAddressQueryVo getDetail(Long id);

    /**
     * 获取用户地址
     * @param uid uid
     * @param page page
     * @param limit limit
     * @return List
     */
    List<YdyUserAddressQueryVo> getList(Long uid,int page,int limit);

    /**
     * 获取默认地址
     * @param uid uid
     * @return YdyUserAddress
     */
    YdyUserAddress getUserDefaultAddress(Long uid);

}
